import Vue from 'vue'
import Router from 'vue-router'

import Login from '@/views/Login'
import Register from '@/views/Register'
import Module from "@/views/system/Module.vue";

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/login' // 默认情况下重定向到登录页面
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/index',
      name: 'index',
      component: Module,
      //路由嵌套
      children:[
        {path: '/app/student',component: () => import('@/views/Student.vue')},
        {path: '/system/user',component: () => import('@/views/system/User.vue')},
      ]
    }
  ]
})
